/*
 * 订单确认
 * */
import request from './request.js'



/**
 * 获取指定金额可用优惠券
 * @param price
 * @returns {*}
 */
export function getOrderCoupon(cartId) {
	return request("/coupons/order/" + cartId, 'get');
}


/**
 * 订单统计数据
 * @returns {*}
 */
export function getOrderData() {
	return request("/api/storeOrder/order/data", 'get');
}

/**
 * 订单列表
 * @returns {*}
 */
export function getOrderList(data) {
	return request("/api/storeOrder/order/list", data, 'get');
}

/**
 * 取消订单
 * @returns {*}
 */
export function cancelOrder(id) {
	return request("/api/storeOrder/order/cancel", {
		id
	}, 'post');
}

/**
 * 订单详情
 * @returns {*}
 */
export function orderDetail(id) {
	return request("/api/storeOrder/order/detail/" + id, 'get');
}

/**
 * 退款理由
 * @returns {*}
 */
export function getRefundReason() {
	return request("/api/storeOrder/order/refund/reason", 'get');
}

/**
 * 提交退款
 * @returns {*}
 */
export function postOrderRefund(data) {
	return request("/api/storeOrder/order/refund/verify", data, 'post');
}

/**
 * 确认收货
 * @returns {*}
 */
export function takeOrder(uni) {
	return request("/api/storeOrder/order/take", {
		uni
	}, 'post');
}

/**
 * 删除订单
 * @returns {*}
 */
export function delOrder(uni) {
	return request("/api/storeOrder/order/del", {
		uni
	}, 'post');
}

/**
 * 订单查询物流信息
 * @returns {*}
 */
export function express(params) {
	return request("/api/storeOrder/order/express", params, 'post');
}

/**
 * 订单查询物流信息
 * @returns {*}
 */
export function payOrder(uni, paytype, from) {
	return request("/api/storeOrder/order/pay", {
		uni,
		paytype,
		from
	}, 'post');
}
/**
 * 订单核销
 * @returns {*}
 */

export function orderVerific(verifyCode, isConfirm) {
	return request("/api/storeOrder/order/order_verific", {
		verifyCode,
		isConfirm
	}, 'post');
}
/**
 * 获取订阅消息ID
 * @param price
 * @returns {*}
 */
export function getSubscribeTemplate() {
	return request("/order/getSubscribeTemplate", 'get');
}
export function submitAfterSealsOrder(data) {
	return request(`/api/storeAfterSales/applyForAfterSales`, data, 'post');
}

export function getAfterSealsList(params) {
	return request('/api/storeAfterSales/list', params, 'get');
}

// 撤销售后订单
export function rebackAfterSeals(params) {
	return request(`/api/storeAfterSales/revokeAfterSales`, params, 'get')
}
// 查询订单
export function getAfterSealsDetail(id) {
	return request(`/api/storeAfterSales/getInfo/${id}`, 'get')
}

// 获取物流信息
export function getExpressData() {
	return request('/api/storeAfterSales/express', 'get')

}

// 添加快递单号
export function addExpressData(params) {
	return request('/api/storeAfterSales/addLogisticsInformation', params, 'post')
}